#ifndef QTMUSIC_H
#define QTMUSIC_H

#include <QWidget>
#include <QEvent>
#include <QMouseEvent>
#include <QPoint>
#include <QDebug>

QT_BEGIN_NAMESPACE
namespace Ui { class QtMusic; }
QT_END_NAMESPACE

class QtMusic : public QWidget
{
    Q_OBJECT

public:
    QtMusic(QWidget *parent = nullptr);
    ~QtMusic();

    // UI界面初始化
    void initUi();

    // 重写QWidget类的鼠标单击和鼠标滚轮事件
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;

    void connectSignalAndSlots();
private slots:
    void on_quit_clicked();
    void onBtFormClick(int pageId);

private:
    Ui::QtMusic *ui;
    QPoint dragPosition; // 记录光标相对于窗口标题栏的相对距离
};
#endif // QTMUSIC_H
